package com.nts.visionworks.core.image;

import java.util.HashMap;
import java.util.Map;

public enum ImageType
{
	JPG,
    GIF,
    PNG,
    UNKNOWN;
	
    private static final Map<String, ImageType> _items = new HashMap<String, ImageType>();
    
    static
    {
    	_items.put("jpg", ImageType.JPG);
    	_items.put("jpeg", ImageType.JPG);
    	_items.put("gif", ImageType.GIF);
    	_items.put("png", ImageType.PNG);
    }

    public static ImageType getType(String extension)
    {
    	extension = extension.toLowerCase();
    	
        if (_items.containsKey(extension))
        {
            return _items.get(extension);
        }
        else
        {
            return UNKNOWN;
        }
    }
}